package com.lhs.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lhs.entity.user.Vip_record;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface Vip_RecordMapper extends BaseMapper<Vip_record> {

        // 查询用户最新的会员记录
        @Select("select id,user_id,vip_level,start_time,end_time,create_time from vip_record " +
                "where user_id = #{userId} order by end_time desc limit 1")
        Vip_record selectByUserId(Long userId);


}
